<template>
    <div class="Child2">
        <h1>子2组件</h1>
        <p>电脑：{{ computer }}</p>
    </div>
    </template>
    
    <script lang="ts">
    export default {
    name:'Child2'
    }
    </script>
    
    <script setup lang="ts">
import { ref } from 'vue';

    let computer = ref('联想')
    // 曝光电脑给父组件
    defineExpose({ computer })
    </script>
    
    <style lang="css">
    .Child2{
        margin: 20px;
        height: 200px;
        width: 400px;
        background-color:blanchedalmond;
    }
    </style>